﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using SmartRoute.Data;
using SmartRoute.Data.ViewModels;

namespace SmartRoute.View
{
    /// <summary>
    /// Interaction logic for CoordinatesEditor.xaml
    /// </summary>
    public partial class CoordinatesEditor : UserControl
    {
        private LocationViewModel viewModelPointer;

        public LocationViewModel ViewModelPointer
        {
            get { return viewModelPointer; }
            set { viewModelPointer = value; }
        }
        /*
        public double Latitude
        {
            get { return viewModelPointer.Latitude; }
            set { viewModelPointer.Latitude = value; }
        }

        public double Longitude
        {
            get { return viewModelPointer.Longitude; }
            set 
            { 
                viewModelPointer.Longitude = value;
            }
        }*/

        public CoordinatesEditor()
        {
            viewModelPointer = new LocationViewModel(Location.WithoutAddress(0, 0));
            this.DataContext = viewModelPointer;
            InitializeComponent();
        }
        public CoordinatesEditor(LocationViewModel viewModel)
        {
            viewModelPointer = viewModel;
            this.DataContext = viewModelPointer;
            InitializeComponent();
        }

        private void LatitudeText_TextChanged(object sender, TextChangedEventArgs e)
        {
            System.Console.WriteLine(ViewModelPointer.Location.ToString());
        }
    }
}
